package com.xujie.sportsmeeting.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 项目热度统计VO
 */
@Data
@Schema(description = "项目热度统计信息")
public class EventPopularityVO {

    @Schema(description = "排名")
    private Integer ranking;

    @Schema(description = "项目ID")
    private Long eventId;

    @Schema(description = "项目名称")
    private String eventName;

    @Schema(description = "项目编码")
    private String eventCode;

    @Schema(description = "项目类型")
    private String eventType;

    @Schema(description = "性别限制")
    private String genderLimit;

    @Schema(description = "最大报名人数")
    private Integer maxParticipants;

    @Schema(description = "实际报名人数")
    private Integer registrationCount;

    @Schema(description = "报名率")
    private BigDecimal registrationRate;

    @Schema(description = "竞争比例")
    private BigDecimal competitionRatio;

    @Schema(description = "热度评分")
    private BigDecimal popularityScore;

    @Schema(description = "参与院系数")
    private Integer participatingDepartments;

    @Schema(description = "院系覆盖率")
    private BigDecimal departmentCoverage;

    @Schema(description = "男子报名数")
    private Integer maleRegistrations;

    @Schema(description = "女子报名数")
    private Integer femaleRegistrations;

    @Schema(description = "是否爆满")
    private Boolean isFull;

    @Schema(description = "等待列表人数")
    private Integer waitingListCount;

    @Schema(description = "历史热度对比")
    private String historicalComparison;

    @Schema(description = "热度变化趋势")
    private String popularityTrend;

    @Schema(description = "推荐指数")
    private BigDecimal recommendationIndex;

    // 获取热度等级
    public String getPopularityLevel() {
        if (popularityScore == null) return "未知";
        
        double score = popularityScore.doubleValue();
        if (score >= 90) return "🔥🔥🔥 超热门";
        if (score >= 70) return "🔥🔥 热门";
        if (score >= 50) return "🔥 一般";
        return "❄️ 冷门";
    }

    // 获取竞争激烈程度
    public String getCompetitionLevel() {
        if (competitionRatio == null) return "未知";
        
        double ratio = competitionRatio.doubleValue();
        if (ratio >= 3.0) return "🔥 激烈";
        if (ratio >= 2.0) return "⚡ 中等";
        if (ratio >= 1.5) return "🌟 适中";
        return "😌 轻松";
    }
}
